Optimal. Leaf size=102 \[ \frac{2 a^2 (2 B+3 C) \sin (c+d x)}{3 d}+\frac{a^2 (2 B+3 C) \sin (c+d x) \cos (c+d x)}{6 d}+\frac{1}{2} a^2 x (2 B+3 C)+\frac{B \sin (c+d x) \cos ^2(c+d x) (a \sec (c+d x)+a)^2}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.2299, antiderivative size = 102, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 40, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.15, Rules used = {4072, 4013, 3788, 2637, 4045, 8} \[ \frac{2 a^2 (2 B+3 C) \sin (c+d x)}{3 d}+\frac{a^2 (2 B+3 C) \sin (c+d x) \cos (c+d x)}{6 d}+\frac{1}{2} a^2 x (2 B+3 C)+\frac{B \sin (c+d x) \cos ^2(c+d x) (a \sec (c+d x)+a)^2}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4072
Rule 4013
Rule 3788
Rule 2637
Rule 4045
Rule 8
Rubi steps
\begin{align*} \int \cos ^4(c+d x) (a+a \sec (c+d x))^2 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\int \cos ^3(c+d x) (a+a \sec (c+d x))^2 (B+C \sec (c+d x)) \, dx\\ &=\frac{B \cos ^2(c+d x) (a+a \sec (c+d x))^2 \sin (c+d x)}{3 d}+\frac{1}{3} (2 B+3 C) \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 \, dx\\ &=\frac{B \cos ^2(c+d x) (a+a \sec (c+d x))^2 \sin (c+d x)}{3 d}+\frac{1}{3} (2 B+3 C) \int \cos ^2(c+d x) \left (a^2+a^2 \sec ^2(c+d x)\right ) \, dx+\frac{1}{3} \left (2 a^2 (2 B+3 C)\right ) \int \cos (c+d x) \, dx\\ &=\frac{2 a^2 (2 B+3 C) \sin (c+d x)}{3 d}+\frac{a^2 (2 B+3 C) \cos (c+d x) \sin (c+d x)}{6 d}+\frac{B \cos ^2(c+d x) (a+a \sec (c+d x))^2 \sin (c+d x)}{3 d}+\frac{1}{2} \left (a^2 (2 B+3 C)\right ) \int 1 \, dx\\ &=\frac{1}{2} a^2 (2 B+3 C) x+\frac{2 a^2 (2 B+3 C) \sin (c+d x)}{3 d}+\frac{a^2 (2 B+3 C) \cos (c+d x) \sin (c+d x)}{6 d}+\frac{B \cos ^2(c+d x) (a+a \sec (c+d x))^2 \sin (c+d x)}{3 d}\\ \end{align*}
Mathematica [A] time = 0.168917, size = 61, normalized size = 0.6 \[ \frac{a^2 (3 (7 B+8 C) \sin (c+d x)+3 (2 B+C) \sin (2 (c+d x))+B \sin (3 (c+d x))+12 B d x+18 C d x)}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.084, size = 116, normalized size = 1.1 \begin{align*}{\frac{1}{d} \left ({\frac{B{a}^{2} \left ( 2+ \left ( \cos \left ( dx+c \right ) \right ) ^{2} \right ) \sin \left ( dx+c \right ) }{3}}+2\,B{a}^{2} \left ( 1/2\,\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) +1/2\,dx+c/2 \right ) +{a}^{2}C \left ({\frac{\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2}}+{\frac{dx}{2}}+{\frac{c}{2}} \right ) +B{a}^{2}\sin \left ( dx+c \right ) +2\,{a}^{2}C\sin \left ( dx+c \right ) +{a}^{2}C \left ( dx+c \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.93984, size = 149, normalized size = 1.46 \begin{align*} -\frac{4 \,{\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a^{2} - 6 \,{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{2} - 3 \,{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a^{2} - 12 \,{\left (d x + c\right )} C a^{2} - 12 \, B a^{2} \sin \left (d x + c\right ) - 24 \, C a^{2} \sin \left (d x + c\right )}{12 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.483474, size = 165, normalized size = 1.62 \begin{align*} \frac{3 \,{\left (2 \, B + 3 \, C\right )} a^{2} d x +{\left (2 \, B a^{2} \cos \left (d x + c\right )^{2} + 3 \,{\left (2 \, B + C\right )} a^{2} \cos \left (d x + c\right ) + 2 \,{\left (5 \, B + 6 \, C\right )} a^{2}\right )} \sin \left (d x + c\right )}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.1778, size = 192, normalized size = 1.88 \begin{align*} \frac{3 \,{\left (2 \, B a^{2} + 3 \, C a^{2}\right )}{\left (d x + c\right )} + \frac{2 \,{\left (6 \, B a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 9 \, C a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 16 \, B a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 24 \, C a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 18 \, B a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 15 \, C a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]